var url;
var body = document.body;
var rightDiv = document.getElementById("right");

module.exports = {
  onshow: function () {
    var _this = this;
    var a = body.$$("#menu a");
    
    for (var i=0; i<a.length; i++) {
			a[i].removeClass("current");
		}
    body.$("#a_plgin").addClass("current");
    
    switch (JFram.queryParam.do) {
      case "infinite" : url = "./html/plugins/infinite.html"; break;
    }
    
    if (!JFram.assets[url]) {
			JFram.ajax({
				url: url,
				dataType: "text",
				success: function(data) {
					JFram.assets[url] = data;
					_this.render(data);
				}
			});
		} else {
			this.render(JFram.assets[url])
		}
  },
  render: function(html) {
		rightDiv.scrollTop = 0;
		rightDiv.innerHTML = html;
	}
}
